Skip to main content

DictionaryWrite Node

The DictionaryWrite Node gets a key-value pair to the Input Port, searches for the key in the Dictionary Collection, writes key-value pair to the Dictionary Collection, returns a status of writing.

DictionaryWrite Node
DictionaryWrite Node

The example above demonstrates the DictionaryWrite Node having the following Input Ports:

  • key Input Port (named by default) gets the name of the key, ex. "key" = "ID1";
  • object Input Port (unnamed by default) gets the value of the key as an object, ex. {"ts": 1000000000, "key": "A", "value": 1}.

The DictionaryWrite Node has an optional boolean Output Port (switched off by default):

  • bool Output Port named is_written sends True value to the output if the key : value pair is successfully written to the Collection named ABCD.

The DictionaryWrite Node has the following Configuration Parameters:

  • Expiration Time in the range from 0 to 172800 seconds to limit the lifetime of the Dictionary.
  • Collection Name to address the Dictionary.

The DictionaryWrite Node allows to add Input Ports of any types of data.

DictionaryWrite Node
DictionaryWrite Node

In the example above the Constant Node writes to the DictionaryWrite Node to the ABCD Collection for the "key" : "ID1" the following “key” : “value” pairs:

  • for “key” : “A” (object data type) writes the value {"ts": 1000000000, "key": "A", "value": 1};
  • for “key” : “B” (number data type) writes the value 3.14;
  • for “key” : “C” (integer data type) writes the value 42;
  • for “key” : “D” (boolean data type) writes the value True;
  • for “key” : “E” (string data type) writes the value "Hello, World!";
  • for “key” : “F” (array data type) writes the value [1, 2, 3, 4, 5].

If the writing performed successfully, the bool value True is sent to the output is_written Port.